//
//  HDIndividualInformationCell.swift
//  HuaDaoPeifu
//
//  Created by liangyuanliangyuan on 16/4/19.
//  Copyright © 2016年 paiyipai. All rights reserved.
//

import UIKit

class HDIndividualInformationCell: UITableViewCell {

    var leftTitle = UILabel()
    var rightTitle = UILabel()
    var rightImage = UIImageView()
    var normalLeftArr = ["姓名","手机号","证件类型","证件号码"]
    var CompanyLeftArr = ["姓名","手机号","用户等级","证件类型","证件号码"]
    var normalRightArr:NSMutableArray?
    
    let phoneVC = HDRegistVC()
    
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        normalRightArr = NSMutableArray(capacity: 1)
        
//        addDataToArray()
        
        leftTitle.font = UIFont.systemFont(ofSize: 15)
        leftTitle.textColor = UIColor(hex: 0x333333)
        self.addSubview(leftTitle)
        
        leftTitle.snp.updateConstraints {(make) in
            make.left.equalTo(15)
            make.width.equalTo(70)
            make.centerY.equalTo(self.snp.centerY)
        }
        
        rightTitle.font = UIFont.systemFont(ofSize: 14)
        rightTitle.textColor = UIColor(hex: 0x999999)
        rightTitle.textAlignment = .right
        self.addSubview(rightTitle)
        rightTitle.snp.updateConstraints { (make) in
            make.right.equalTo(-15)
            make.left.equalTo(leftTitle.snp.right).offset(20)
            make.centerY.equalTo(self.snp.centerY)
        }
        
        rightImage.isHidden = true
        self.addSubview(rightImage)
        rightImage.snp.updateConstraints { (make) in
            make.right.equalTo(-15)
            make.width.equalTo(35)
            make.height.equalTo(16)
            make.centerY.equalTo(self.snp.centerY)
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
//    func addDataToArray() {
//        
//        let nameText = "张三"
//        let phoneText = "18686233966"
//        let userType = "个人用户"
//        let idType = "身份证"
//        let idNumber = "150221199312212345"
//        normalRightArr?.addObjectsFromArray([nameText,phoneText,userType,idType,idNumber])
//        
//    }
    
    //刷新cell的数据
    func refreshNormalCell(_ index:IndexPath) {
        leftTitle.text = normalLeftArr[index.row]
    }
    
    func refreshCompanyCell(_ index: IndexPath) {
        leftTitle.text = CompanyLeftArr[index.row]
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}


